#include "workspace.h"
#include "wlroots-full.hpp"

Workspace::Workspace(const std::string &name, Server *server)
    : m_server(server)
    , m_name(name)
{
    m_tree = wlr_scene_tree_create(server->m_view_tree);

#if 0
    wl_list_append(&server->workspaces, &workspace->link);
    if (!server->workspace_current) {
        server->workspace_current = workspace;
    } else {
        wlr_scene_node_set_enabled(&workspace->tree->node, false);
    }
#endif
}

void Workspace::set_enabled(bool enabled)
{
    wlr_scene_node_set_enabled(&m_tree->node, false);

}

void Workspace::workspaces_init(Server *server)
{
    Workspace *w = new Workspace("main", server);
    server->m_workspaces.push_back(w);

    if (!server->m_workspace_current) {
        server->m_workspace_current = w;
    } else {
        wlr_scene_node_set_enabled(&w->m_tree->node, false);
    }
}
